<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" />

        <title>create table</title>

        <usergroup>
            0
        </usergroup>

        <usergroup_edit>
            40
        </usergroup_edit>

      

        <menu_active>
            1
        </menu_active>

        <title_active>
            1
        </title_active>

        <template>
            script.html
        </template>
    </head>

    <body>
        <?php
        
        require_once(config::$basePath."/system/api/simplehtmldom/simple_html_dom.php");  
        
        
        
        $tableName=trim($_REQUEST['table']);
        
        $scaffolding=false;
        if (isset($_REQUEST['scaffolding']))
            {
            $scaffolding=true;
            }

            
        
            
            
            
   //         nm_table="true" external_table="team"
            
            
  
  $xmlTable = new xml_table();
  $xmlTable->tableName = $tableName;
  $xmlTable->scaffolding = $scaffolding;
  $tableName = $xmlTable->createTable();
  
  
       
       
       
       
       
       /* $xmlDatabase=new xml_database();
        $xmlDatabase->baseDir=false;
        $xmlDatabase->xmlFilename=config::$projectPath . "/db/db.xml";

        $scaffolding=false;

        if (isset($_REQUEST['scaffolding']))
            {
            $scaffolding=true;
            }

        $tableName=$xmlDatabase->createTable($table, $scaffolding);


        //echo $table;
        $xmlDatabase->writeXmlDatabaseFile();

        
        
        // Scaffolding
        if ($scaffolding) {
            
        /*    $s = new scaffolding();
            $scaffoldingAdministration = new scaffolding_administration();
            
            
            $scaffoldingAdministration->xmlDatabase
            $scaffoldingAdministration->createAdministration() */ 
      //  }
        
        
        
        

        //$redirect = "/admin/db-verwaltung?table=$table";
        $redirect="/database-management?table=$tableName";
        http::redirect($redirect);
        ?>
    </body>
</html>